Fixed while to for