changed min_size parameter to min_shift