What is the purpose of ```g``` ? you could rename this variable to make its purpose more clear.