Newton's  method to calculate square root