private void replaceCharactersInBlock(TMState start, String toReplace, String replaceWith){ //this shall be a recursive method, replacing the inside and then the out

            TuringMachine tm = start.getInnerTM();
                
            for (int i = 0; i < tm.getStates().length; i++)
                replaceCharactersInBlock((TMState)tm.getStates()[i], toReplace, replaceWith);      
            
            Transition[] trans = tm.getTransitions();
            
            for (int i = 0; i < trans.length; ++i){
                TMTransition tmTrans = (TMTransition)trans[i];
                for(int k = 0; k < tmTrans.tapes(); k++){
                    String read = tmTrans.getRead(k);
                    tmTrans.setRead(k, read.replaceAll(toReplace, replaceWith));
                    String write = tmTrans.getWrite(k);
                    tmTrans.setWrite (k,write.replaceAll(toReplace, replaceWith));
                }

            }
        }