Added in AddEvent function and reformatting