Just some haskell functions etc