adds Packet class and updated recv() and send()