some modifications to address comments from Adi