Some serious refactoring.
Need to do more research on the ACK packet.