Attempt at recursive template