Implemented a preliminary state machine for tuner.