debugged code, halfway there with learn ruby the hard way.