merge both repairEM into one function

which one depends on the priority.txt file. It works.