changed function names and added docstrings