The algorithm now works!