implemented split/2 and partition/2