attempted solution
quicker solution. Should of done this first I think