added functionality for template and makemap