begin to write with switch