packing function in progress