rewriting the app using ree