Slight modifications

added a divide-by-zero exception, which should be irrelevant, but isn't.