It's working, but very slow, going to try remove some code to optimise it a little bit