Replaced forloopcounter with i