Prioritize tasks with dynamic matrix