Added documentation comments and refactored hud.