Changed int to template T