A turing machine implementation