added featur to return -1 if there are no duplicate letters found