Changed division code to much simpler versions.