More generic function to get path between two states
Transition action sequence (buggy)