switch code and pre