changed splitting logic a bit