Not necessary to fix, but perhaps a context manager for result might be nice.