minor changes with indentations and comments