Added final code of the app