Added unit test and updated the doc block