Implement first version of handeling packets - reading and writing them