packing logic built