changed switches to use enumerations