switched order of operations