Problem 5: use foldr1 instead of foldr