Working on implementation fish-moore alg