added a switch statement from IO powerpoint