def mysqrt(a, epsilon=0.0000000000000001):
    """Uses Newton's Method to return an estimate of sqrt(a)
       a: nonnegative number
       epsilon: final step size/accuracy
    """
    if a<0:
        print("a must be nonnegative.")
        return
    x=a/2
    while True:
        #print(x)
        y = (x + a/x) / 2
        # Instead of checking to see if x=y, use epsilon to avoid
        # floating point representation issues
        if abs(y-x) < epsilon:
            break
        x = y
    return x