ignore dist directory
whitespace and docstring cleanup
handle non-existing files more gracefully