Copying ffLab for local usage
porting existing code to new algorithm