added use_dirty flag to bucketsort