new method to generate TM