reformat exercise 3 as per chrisdone's haskell style guide.