Changing from array tracking of commands to stack tracking of commands