making a few minor changes in the code