finished 6th problem