modified templates for cpp