changed Events to refer to objects by pointer instead of reference
added diagnose script