Update tsm.c

added better intial random