Hello I tried reading your code and try to remake my own but nothing works can you explain the algorithm?