renaming event to inputevent and adding stateevents
removing unnecessary stuff
adding more state events, more functions to controll the state's flow