Added a loading animation
Cleaned up some js