square root added to problem 3 solution