added new reverse function