iteratively way