added varType function