Added program state diagram