completed problem6