update comments and add unit test