Fix to 3 way splitting code