problem 12, definitely getting better at Ruby-ing