Some updates
Fixed divide by zero