Zach: make a separate thread