Main change of algorithm + Socket initialize to lib