Added TypeVar stuff as requested