added comment and minor changes