egcd(), inv_mod() added.