Off by one error in toString, the last node is at index maxNumber-1.