change todoList function with template library