start cfanim reimplementation (not yet finished)