Implementation for "add-one" function using the Turing Machine concept