Homework 1

It is working but does not feel like idiomatic haskell.