Added method chaining to reverse() function