chapter 3 exercises -reverse using foldLeft and without