square root exercise (not optimized version)