lu automata hw2: formatting and fixes
lu automata hw2: test for empty