added a simplified algorithm ( would later be replaced by a more efficient (algo "diver") )