A separate method might be a little more flexible

I made this method in the course of testing many things; in the end this
is basically the same as the last version.