fixed calc errors