Assertions added. Comments fixed. Minor reformatting done.