finished function to analyze the string and determine conclusion