This function could be named better, and in addition, should have a doc string.