Implementation of split simplified by implementing a new function