added different modes and polygoncomplete event. Added different states: create edit delete for gui / state_machine