sorted imports
added docstrings to abstract function