Added Assertions and comments.