Some improves and adding docstrings