Added debugmode, State names and next State