Added Listener and set up main class