completed fold right with foldl