made tds_elem more general and added support for pointer ctype elements