use function to generate title slide