added automata example
modifications for mobile device support