included some host arch detection
added full threading support