implement list packing for lecture exercise
refactor list packing for beauty