made minor changes to bring this in as a dialog box into main UI