Added a loading screen

Cleaned up the code a bit also.