Sort values using game loop