reimplementation of the graph code + implementation of prime number function and priority queue (min, max, indexed)