take ghc warnings seriously
replace powers with multiplication for sake of performance (7% improvement)