Basic fixes
Algo compiles
Add generic algo part