adi's code integrated