reverted to the priority queue since vector was not faster due to the sorting at the end. added const in the parameters for the comparator in q3