Broke parsing of commands into a separate function and added moving flag.