Correct reverse function