Adding algebraic module and revised version of generic ttg function