moving template back into script - fixes #38