Serial flush - seems I can't get it to clear data

Serial.flush() waits for the transmission of outgoing serial data to complete. Is that what you are trying to do ?