public WordArranger(String[] words, WordSearch wordSearch)
	{
		this.wordSearch = wordSearch;

		wordPositions = new ArrayList<>();
		for (String word : words)
		{
			Direction direction = Direction.getRandomDirection();
			Point point = getRandomPoint();
			wordPositions.add(new Word(word, direction, point));
		}

		List<Word> invalidWords = new ArrayList<>();
		int attempts = 0;
		do
		{
			findInvalidWords(invalidWords, wordPositions);

			switch (++attempts)
			{
				case 50000:
					System.out.println("This is taking a while...");
					break;
				case 150000:
					System.out.println("These words weren't designed to be put into a wordsearch...");
					break;
				case 500000:
					System.out.println("Ahem...");
					break;
				case 1000000:
					System.out.println("Could not produce a wordsearch with these words and this size, please try again!");
					System.exit(1);
					break;
			}

		} while (!invalidWords.isEmpty());

//		System.out.println("number of generation attempts: " + attempts);
		updateGrid(false);

	}