Learning to execute commands