Added a loading screen and fixed bugs