finish the impelmentation of crf.