Added docstrings, removed commented code and tick code, renamed function