+ prim alg
+ some refactoring in pq