Added pretty much all the event handling + the controller calls