Improving divisor function