first cut of computing gap statistic