use built in range for problem 6