Updated length initialization to be multiples of 7 and speed up inventory functions