ammended code