added data threshold option
ugh, hideous merge