Bunch of stuff

Forgot to open this so yeah...
Fairly certain most things are commented or obvious