Added comments and fixed up test.