Now has multi-thread support