Removed unnecessary A_Xinv_B function.