Added packet encoder and decoder