Added control and main. Added unit test for control. Added state.