translated into more idiomatic ruby
housework
removing newlines and indentation