added th1
added macro for calling functions on derived classes
added th1