pep8
More idiomatic kwargs handling.
tabs to spaces.
Trailing spaces.
Fix typo: use the distances between items, not the distances between their indices.
Simplify constructors.