best partition computation written