Added more documentation.
More comments added.