Added further test comments, and slight refactoring.