Changed code to reflect highpriority = low value and lowpriority = high value