Implemented a lot of the dialog class