Added an extra to the intent to pass data between the activities
cleaned up the code