changed input, added threads