lists:split/2 will probably make it much clearer, so I will change to that.