mathyrubyintro 1 refactored