wrote findTransitions (i think lol)