program splits words to array and checks for doubles