Added gather() method to parse input string from Pi.