Added mr algorithm