added the main and template