The variable names were translated from portuguese to facilitate understanding, so, if there is a typo here, it is probably not present in the real code
with