Add thread numbering system