how to reverse a set of numbers