added template inheritence