solve for box working for array.size == 1 and 1 remaining value