first working version, but without replying to threads mechanism