improve code format, logging
add docstrings

(only keeping up github streak ;D )