added a simple template and function