Moved transition checking into its own function

190ms/run