improve of priority_queue algorithm