update Problem 6