Added single-threaded support