Some minor cleanup and comments added