added docstrings and class templates