made some modifications for Adi