Translated more things and included code from aff_tr.h