implemented my-reverse function