Made some changes in the code