added template
cleaned up script