Algorithm implemented #1