Add initial (very buggy) multithreading code