solved p6 with haskell
solved p3 with haskell