If I am honest this code is a bit of a mess so if you guys think it would be worth redoing let me know