Added ability to get the last code that caused a transition