added conditional to print @match.length if @match isn't nil