cleaned up coding style to match style suggested by Ruby style guide