Implementing reading thread