finished probem 6