changed return type for reverse() method from INT to VOID