added statemachine idea code
added program idea