Added automata functions and  mouse wheel scrolling