I think this block is best placed before the division: this way no division by zero can occur.