revised ch6/priority_queue based on ex6.5-6