Minor fixes and addition of a algorithm