Add comments to master thread functions