implemented a priority q using max heaps