OperateWithPriority Method modified to be smaller, unnecesary variables. not used imports also removed