added checkImport, checkDimensions and corrected for/switch control functions