smart splitting and shuffling added