Addedd threading and semi-fixed unicode encoding