Sorting rows of database according to priority
Incorporated all of the database data into the knowledgeBase and eliminated other messy arrays.