Do you have any type of pull-up resistor? (or pull-down, i guess.)
When the switch pin is not connected to anything, it is floating, and can randomly report as being either high or low erratically.
Try doing digitalwrite(switchpin, HIGH) to use th built in pullups, and connect the switch to ground instead of 5v. You may have to change a HIGH to a LOW in the code somewhere.