#307 delete better algo