working to ex6
ex 8 finished