Update several functions so that the process is more computationally efficient.