Algorithms for doing division