random generation and order system working