working loop, however order may be not valid...