Learning the next keyboard to go to next iteration of loop