Update middle, Rum, Tum, NCP, UL fuctions

I found that NCP and UL are not related to orginal record, so I remove one var from these fuctions.

For middle fuction, I add transaction part get_LCC.

get_LCC is a transaction generalization fuction for transaction part of records (last one)