Some Changes to the Code