Added in all event handling and some utility functions. complex objects have been added as well