comments added, more modifications done