Algorithm complete