comments added and typo fixed