Added priority colors and sort function