fixing an embarassing typo
cleanup and ruby-ifying