Add minor changes to order of functions