i have made some changes in the code