Reverse with foldl and foldr implemented