Changed order of functions.