Version2.x

Rework most of the code and fix any problems