             g_LastButtons.up_button == 0)
         {
             digitalWrite(9, HIGH);
+            discharging = false;
         }
         if ( g_Buttons.bottom_button != 0 &&
             g_LastButtons.bottom_button == 0)
         {
             digitalWrite(9, LOW);
+            charging = true;
         }
     }
     else if ( mode == MODE_LCD_TIMER)

    MODE_CHARGE,
    MODE_DISCHARGE,
    NUM_MODE_ENUMS,
    MODE_SERIAL_MON,
};

char str_vcc[6];
char str_volt[6];
char serial_buf1[20];
char serial_buf2[20];
int serial_buf_line_no = 1;

            g_LastButtons.up_button == 0)
        {
            digitalWrite(3, HIGH);
            discharging = false;
        }
        if ( g_Buttons.bottom_button != 0 &&
            g_LastButtons.bottom_button == 0)
        {
            if( voltage >= 3.0 )
            {
                digitalWrite(3, LOW);
                discharging = true;
            }
        }
        if( voltage < 3.0 )
        {
            digitalWrite(3, HIGH);
            discharging = false;
        }
    }
    else if ( mode == MODE_CHARGE)
