added template and code example