clearer implementation and adapt docstring info