Rewrote threading which was fucky