Comments added and modified in some places