Out of memory, how to reduce this program's size

static const int RXPin = 5, TXPin = 4; //GPS is attached to pin 4(TX from GPS) and pin 5(RX into GPS)
SoftwareSerial ss(RXPin, TXPin);

This looks the wrong way round, to me. The first parameter of the SoftwareSerial constructor, is the pin which is the input signal into the Arduino. This would appear to be inconsistent with what the previous line in your code implies.