Add docs, introduce partition() helper func