added naive sqrt solution