add app.java that run the main loop