completed support for switch statements and added tests