Added reverse mode functionality