Multithreading success. Needs tidying up and testing