Added dollar sign to i var in for loop