added some comments
minor changes