implement reverse and product using folds