use right fold to append