Tested and added docstring