Added a method to parse the input and obtain the result from the main activity class