Refactored packing algorithm, partial: new packaging