If your problem was with the flush() function then using SoftwareSerial won't help because the function does not exist in the SoftwareSerial library
If your problem was with the flush() function then using SoftwareSerial won't help because the function does not exist in the SoftwareSerial library