Added HUD and optimized login code