Slight clean up
Broken commit
finishing the implementation of the generic algorithm