added replace_add_fgfg with which TR10_inv is fast and powerful