bug fix: previously the scenario recorded excluded the button that's just clicked, this is not intended. Also tightened the code a bit.