change the order of the function