final code for the mobile application