Changed functionality to act as a member of MainActivity