changed _ref to _first or _max