Added template inheritance + impovements, still need to fix selection