add graph output and some events
merge changes