Updated makepacket()

Updated the header portion of makepacket() as well as the affected code.
Removed code that was unintentionally left in the program that should have been deleted in previous commit.