add switch function, not implemented for now