changed all "lengths" to "vcount" for sampling