Reordered some functions.