use mutable function argument syntax in treemap/priority_queue