break out math utils; fix some numbers & clean up readability