Correct Algorithm, how stupid I was!
Very slow...
Very slow!..