fixed 8th problem solution