Splitting Logic Added. Should be right, untested.