ProgressDialog added. Minor changes needed.