solution 9: pack