move back flattenTerm before CompileDataStructures