Added concurrency capabilities. Still need to add better clean up after error and will change to a better interface