pack routine