Starting to integrate codes into finite state controller