Better binary split function