Added necessary increment to reverse function