to this version I want to add threads