cooking some math

added two utility methods