iteration solution
code style optimization