working templates and some list functions