Working version with communication to the app.