This function seemed to be in the wrong place.