minor changes, code comments added