Use f(x) to update priority queue instead of g(x)