modified code to consistently refer to the variable/constant called gridSize instead of hardcoded values of 100 or 50 (for half).