A Self-Correcting Version of Karmarkar’s Algorithm