updated to give N counts