State machine for multiple trials in place