main TypeChecker functions