tested example successfully for plotPriorities function