Ready and TheEnd states implemented. TODO: nested states.