Need to debug splitting algorithm