changes applied from advice in http://kivy.org/docs/api-kivy.app.html