explained recent changes
reduced calls to malloc
correct fix of serial->write with buffer bug