Reorganized order of functions to match header.