changed the simex function so that we can use 'variable' instead of 'state'