reformatted the code, with no highlights of important lines but with Ruby syntax higlighting