Added button class, modified states to handle events