Updated state machine logic, fixed syntax error
Added schedule finding methods