Fix formatting and add some comments to conform to ruby style guide standards