added some comments and few minor changes