New state-machine with decorator (working)

Still not all functions convertet