switch: initial implementation