solved problem 6 in scheme