Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision 0df292b04fcd4abcd8d5a0f73a254c33e6494808)
@@ -89,4 +89,5 @@
 		};
 
+		/// Prunes a list of alternatives down to those that have the minimum conversion cost for a given return type; skips ambiguous interpretations
 		template< typename InputIterator, typename OutputIterator >
 		void pruneAlternatives( InputIterator begin, InputIterator end, OutputIterator out, const SymTab::Indexer &indexer ) {
@@ -353,5 +354,4 @@
 
 	bool AlternativeFinder::instantiateFunction( std::list< DeclarationWithType* >& formals, /*const*/ AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave ) {
-		std::list< TypeEnvironment > toBeDone;
 		simpleCombineEnvironments( actuals.begin(), actuals.end(), resultEnv );
 		// make sure we don't widen any existing bindings
Index: src/ResolvExpr/AlternativeFinder.h
===================================================================
--- src/ResolvExpr/AlternativeFinder.h	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ResolvExpr/AlternativeFinder.h	(revision 0df292b04fcd4abcd8d5a0f73a254c33e6494808)
@@ -30,4 +30,5 @@
 		AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env );
 		void find( Expression *expr, bool adjust = false );
+		/// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types
 		void findWithAdjustment( Expression *expr );
 		AltList &get_alternatives() { return alternatives; }
Index: src/ResolvExpr/FindOpenVars.h
===================================================================
--- src/ResolvExpr/FindOpenVars.h	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ResolvExpr/FindOpenVars.h	(revision 0df292b04fcd4abcd8d5a0f73a254c33e6494808)
@@ -21,4 +21,5 @@
 
 namespace ResolvExpr {
+	// Updates open and closed variables and their associated assertions
 	void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
 } // namespace ResolvExpr
Index: src/ResolvExpr/RenameVars.cc
===================================================================
--- src/ResolvExpr/RenameVars.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ResolvExpr/RenameVars.cc	(revision 0df292b04fcd4abcd8d5a0f73a254c33e6494808)
@@ -118,5 +118,7 @@
 ///     type->print( std::cout );
 ///     std::cout << std::endl;
+			// copies current name mapping into new mapping
 			mapStack.push_front( mapStack.front() );
+			// renames all "forall" type names to `_${level}_${name}'
 			for ( std::list< TypeDecl* >::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
 				std::ostringstream output;
@@ -125,4 +127,5 @@
 				mapStack.front()[ (*i)->get_name() ] = newname;
 				(*i)->set_name( newname );
+				// ditto for assertion names, the next level in
 				level++;
 				acceptAll( (*i)->get_assertions(), *this );
@@ -132,4 +135,5 @@
 
 	void RenameVars::typeAfter( Type *type ) {
+		// clears name mapping added by typeBefore()
 		if ( ! type->get_forall().empty() ) {
 			mapStack.pop_front();
Index: src/ResolvExpr/RenameVars.h
===================================================================
--- src/ResolvExpr/RenameVars.h	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ResolvExpr/RenameVars.h	(revision 0df292b04fcd4abcd8d5a0f73a254c33e6494808)
@@ -25,4 +25,6 @@
 
 namespace ResolvExpr {
+
+	/// Provides a consistent renaming of forall type names in a hierarchy by prefixing them with a unique "level" ID
 	class RenameVars : public Visitor {
 	  public:
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision 721f17ac6221a75230b4b1228917e6a163b53ff6)
+++ src/ResolvExpr/Unify.cc	(revision 0df292b04fcd4abcd8d5a0f73a254c33e6494808)
@@ -73,4 +73,6 @@
 	};
 
+	/// Attempts an inexact unification of type1 and type2.
+	/// Returns false if no such unification; if the types can be unified, sets common (unless they unify exactly and have identical type qualifiers)
 	bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common );
 	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
@@ -148,4 +150,5 @@
 			if ( curClass.type ) {
 				Type *common = 0;
+				// attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to
 				std::auto_ptr< Type > newType( curClass.type->clone() );
 				newType->get_qualifiers() = typeInst->get_qualifiers();
@@ -280,4 +283,8 @@
 		TypeEnvironment debugEnv( env );
 #endif
+		if ( type1->get_qualifiers() != type2->get_qualifiers() ) {
+			return false;
+		}
+
 		bool result;
 		TypeInstType *var1 = dynamic_cast< TypeInstType* >( type1 );
@@ -292,7 +299,6 @@
 		bool isopen1 = var1 && ( entry1 != openVars.end() );
 		bool isopen2 = var2 && ( entry2 != openVars.end() );
-		if ( type1->get_qualifiers() != type2->get_qualifiers() ) {
-			return false;
-		} else if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
+
+		if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
 			result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
 		} else if ( isopen1 ) {
