implement prioritization function, limit # of links