What influenced Karl Marx to develop the idea of socialism?