MainActivity: Main function implemented