diff --git a/main.py b/main.py
index b7ebfae295827a9e71c546219312c35ee687c1f5..27813546f18d74b099ced74e59e6ca5fbf5bd702 100644
--- a/main.py
+++ b/main.py
@@ -1,4 +1,5 @@
 from kivy.app import App
+from kivy.properties import BooleanProperty, StringProperty
 
 # The following lines ensure that FirstScreen and SecondScreen are available for when the Kv code is loaded.
 
@@ -12,13 +13,19 @@ from second_screen import SecondScreen  # pylint: disable=unused-import
 
 
 class TwoScreenApp(App):
+    advancing = BooleanProperty(True)
+    current_screen_name = StringProperty()  # We must wait to select a screen until the app starts.
+
     def open_first_screen(self):
-        self.root.transition.direction = 'right'
-        self.root.current = 'first'
+        self.advancing = True
+        self.current_screen_name = 'first'
 
     def open_second_screen(self):
-        self.root.transition.direction = 'left'
-        self.root.current = 'second'
+        self.advancing = False
+        self.current_screen_name = 'second'
+
+    def on_start(self):
+        self.open_first_screen()  # Once the app starts, we can select the starting screen.
 
 
 if __name__ == '__main__':
diff --git a/twoscreen.kv b/twoscreen.kv
index ca47926547a9d440a91391d2925718b50e06e4fc..331e11125fab04ad80a3bfce63e38777258d9627 100644
--- a/twoscreen.kv
+++ b/twoscreen.kv
@@ -1,8 +1,13 @@
+# We import the type of transition we want so that we can use it in the `transition` property below.
+# Imports have three parts: #:import, the name we want to use in our code, and the fully qualified name.
+
+#:import SlideTransition kivy.uix.screenmanager.SlideTransition
+
 ScreenManager:
+    transition: SlideTransition(direction='right' if app.advancing else 'left')
+    current: app.current_screen_name
     FirstScreen:
-        id: first
         name: 'first'
     SecondScreen:
-        id: second
         name: 'second'
         message: 'This is a message!'  # The app sends information to the custom widgets by setting their properties.