refactor out send code
better ack and nack handling pre flashing, refactor functions, remove unused code
refactor out switch to 100k mode, remove now duplicate code
refactor all code out of main