create a t matrix
wrap in a def