compiling version with templates, still segfaults as nothing is adapted