Created exec function to take in a robot and a list of instructions to follow