Control Logic Made Easy with Stateflow