used switch statements. working out priorities.