Attempted solution for 10
Final solution for 10