Changed logic to serial pump

Also better comments and structure to the code.  Removed some unneeded
debuggin statements that were getting in the way and fixed some bugs
i found on inspection.