Turing Machine simulator in Java