Got functions for assembling packet and packet data structure working