updated commeting to reflect wwhat the first if statment was doing