priorityqueue to tuple function updated