moved index incremention back to top, to make sure it will still be executed when an continue statement will be added to the loop