Have a working simulation
Fixed merge problems