implemented switch statement