add docstrings and removed unused parameters