added reverse functionality