improved degree calc to take into account degrees of zero