implement reverse with fold-left and fold-right