implemented switch statements. (not sure if i'll keep them)