I would start by reading the sticky "how to use this forum", specifically the point how to post code. That will prevent the italics.
How is your button wired? Using external pull-down or pull-up resistor? If not, the input is prone to noise and that might result in an incorrect reading.