add function for printing type name and value