finalized get_tms module