var traverseDomAndCollectElements = function(matchFunc, startEl) {
  var resultSet = [];
  
  if (typeof startEl === "undefined") {
    startEl = document.body;
  }

  // your code here
  // traverse the DOM tree and collect matching elements in resultSet
  // use matchFunc to identify matching elements

  return resultSet;
};


// detect and return the type of selector
// return one of these types: id, class, tag.class, tag
//
var selectorTypeMatcher = function(selector) {
  // your code here
};

var matchFunctionMaker = function(selector) {
  var selectorType = selectorTypeMatcher(selector);
  var matchFunction;
  if (selectorType === "id") {
    // define matchFunction for id

  } else if (selectorType === "class") {
    // define matchFunction for class
    
  } else if (selectorType === "tag.class") {
    // define matchFunction for tag.class
    
  } else if (selectorType === "tag") {
    // define matchFunction for tag
    
  }
  return matchFunction;
};

var $ = function(selector) {
  var elements;
  var selectorMatchFunc = matchFunctionMaker(selector);
  elements = traverseDomAndCollectElements(selectorMatchFunc);
  return elements;
};

@@ -492,24 +492,213 @@
 de here%0A%7D;%0A%0A
+%0A// NOTE ABOUT THE MATCH FUNCTION%0A// remember, the returned matchFunction takes an *element* as a%0A// parameter and returns true/false depending on if that element%0A// matches the selector.%0A%0A
 var matchFun

Update selector.js