Changed name of function to be more general.