Since the first if returns on success, we should just get the countMatches into a variable, and check it to determine which type of StarPathElement to create.