Variables reset when opening/closing serial monitor

When you reopen the serial monitor on the Uno R3, it causes a reset signal, and the processor starts over.