new function to diff tm structures