Added Main class and Event Hanlders