compute segment counts in the background, closes #26