Added tests.
Added a few comments.