handling the various messages sent from Node to max. not sure what it all adds up to, yet.