loops through instructions