combined math.sqrt operations to save one step