Massive updates to a working version
Fixed merge