Added further documentation and testing.