rewrite code of yaftx for ver0.2.5