added the needed functions - TM