Attempts at threading...not very succesful