Added cpp template
Writes output to file