sort deps by priority