complete the template codes