Set up framework of sort by priority method