Attempting to fix zero divisor error