Add variable value of switch posion
Add checkswitch function