Added code for threading

Creates one thread for each input vector. Should be safe, not entirely
sure how well this will work though