Update stacksExtractStats.pl to be more general