Added reverse function and its documentation