maurers algorithm