Again, might be useful to have a few unit tests around just this function.