Added some tests and comments