added comment and removed redutant code