revision of https://github.com/szem06/Turing-machine