added new test case and fix. Also added more docstring and changed
method name