Emit implemented and general packing function added.