Cleanup, state machine works
Fixed conflicts (which were my fault :P)