added some comment on the previous code