Added loading bar and made minor changes.