Goals and Actions: Learning by Imitation