Changed program to run one thread with asynchronous calls