Moved nextnumber from class var to c var