added comment and remove unnecessary code