I can't (shouldn't) store more than one full message in memory at a time.
Reworked the final function.  It mostly works now.