Modified Example Code,Working