Need the void loop to run just once...

// want the loop to end here and go back to listening for commands from the phone

It does.

Humour me and put this in as the first line in loop:

serialA =0;