// the entire ranking model, in production, since March function rank(waitlist, slot) { return waitlist .filter(p => p.canSee(slot.provider) && p.reachable()) .sort((a, b) => b.urgency - a.urgency || a.minutesAway(slot.site) - b.minutesAway(slot.site) || b.acceptRate - a.acceptRate) .slice(0, 3); }