The switches do not have pulldowns: when not pressed, the pin just sees an open circuit. The only way I could get them to work right is:
dir~~ drive the pin
waitcnt() I/O pipelining?
in read it
Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.