added rough draft of threading