using sum instead of foldl.
used stdlib factorial instead of hand rolled one. I think it looks cleaner though I'm not sure it runs faster.