changed switches to use where with a pattern