Added print statements and divide by zero check