Combined all current code

Lots of stuff