change foldl to foldl1