priority queue implemented, but not tested much yet