Square root implementation