Been a while since I last handled Haskell coding, could have done better but a good day to do it.