Solution for foldl'