add declaration of variables and functions.
modify title setting.