Added reverse_last_actions and compare function