splitWith function