modivied adinc code