Software button debounce.

If these are real physical buttons I wouldn't bother with the software debounce. I would just put a 10k resistor and 0.1 to 1 uF cap.
see attached. Some people prefer software debounce. I'm a H/W person and find H/W more reliable.

SwitchDebounce2.jpg