lots of new code + v2

Lots and lots of new code!