rewrote the threading, added a command to runPrograms from a vector of commands