Added a few eventHandlers and their corresponding function
Implement the main drawing logic