Added multithreading to feedforward