completed calfflac.cpp