almost done, need to run thread testing