First working example with one thread