What about this implementation?

Don't like that i use 2 threads. Need to do something with that.