Rearranged commands to order of operations