Added ability to write packet to a text file