changed code in mealy