single-threaded example