Added a lot of changes in

tbh, i can't be bothered to see what i did here, just have a look
through the code