clean source code for hcwin project
replace while loop by for loop