we can clean this up, but please take a look at the surrounding code and match the style.

* no single letter variables
* no parentheses around parameters to control statements (if, then, else)
* do/end on multiline blocks