Improved order number generation