Added correct dialog.  Clean up some code