private static void checkForLoop (ForagerAnt fAnt)	{
		boolean nodeFound = false;
		
		// Sets the node on the top of the stack to be examined
		ColonyNodeView startingNode = fAnt.movementHistory.peek();
		
		// Creates a stack containing the forager ants movement history
		Stack<ColonyNodeView> foragerAntStack = null;
		foragerAntStack = (Stack<ColonyNodeView>) fAnt.movementHistory.clone();
		
		//Removes the top node that the ant is currently in and sets a variable to new top node
		foragerAntStack.pop();
		ColonyNodeView nodeToCompare = null;
		
		// Loops through movement history to find if the current node has already been stored.
		// Deletes the top node until a match is found. If no match is found, movement history
		// stack is kept the same.
		while ((nodeFound == false) && (foragerAntStack.isEmpty() == false)) {
			nodeToCompare = foragerAntStack.peek();
			
			if (nodeToCompare == startingNode)
				nodeFound = true;
			else
				foragerAntStack.pop();
		}
		
		// Sets the foragers ant movement history to the shortened stack if a match was found
		if (nodeFound == true)
			fAnt.movementHistory = foragerAntStack;
	}