Added support for moving forwards and backwards to perform_commands.