finished problem 13 w/ Haskell