fixed bug in cull_dataset