added comment and slightely modified