implements reverseEach method