The dynamics of economic systems, or how to transform a failed socialist economy