fixing pack_init

put a for loop in pack_init