code: function determineBestParent(conn, objUnit, handleBestParent){
  	conn.query(
  		"SELECT unit \n\
  		FROM units  \n\
  		WHERE unit IN(?) \n\
  		ORDER BY witnessed_level DESC, \n\
  			level-witnessed_level ASC, \n\
  			unit ASC \n\
  		LIMIT 1", 
  		[objUnit.parent_units], 
  		function(rows){
  			if (rows.length !== 1)
  				return handleBestParent(null);
  			var best_parent_unit = rows[0].unit;
  			handleBestParent(best_parent_unit);
  		}
  	);
  }
docs: for unit that is not saved to the db yet function determineBestParent(conn, objUnit, arrWitnesses, handleBestParent){