Added some comments and unit tests.