added higher order haskell functions