reduce pow() call for performance issue