Added reverse command, cleaned some code.