...$max should have been $max+1, however the list is checked and corrected in the following code section so all that is needed to be done here is to push the item on to the (empty) list. This avoids having the rounding done in two places.