adding reverse functionality