write down map-switch impl