Create accumulate example - used Haskell exercise as template