implementing split logic