public void placeQueens(int boardSize)
        {
            ArrayBasedStacks<int> s = new ArrayBasedStacks<int>(boardSize);
            final = new ArrayBasedStacks<int>(boardSize);

            Boolean success = false;

            // row =  location within the stack, column = the element placed in the stack
            s.Push(1);

            while (!success && s.top != boardSize)
            {
                int x = 0; // placeholder for when we pop values
                Boolean conflict = false;

                // check for conflicts
                for (int i = 1; i < s.Count(); i++)
                {
                    int deltarows = s.Count() - i;
                    //check if same column or same diagonal

                    if (s.Peek() == s.get(i) || Convert.ToInt32(s.Peek()) == Convert.ToInt32(s.get(i)) + deltarows || Convert.ToInt32(s.Peek()) == Convert.ToInt32(s.get(i)) - deltarows)
                        conflict = true;
                }

                if (conflict)
                {
                    while (Convert.ToInt32(s.Peek()) == boardSize)
                        x = Convert.ToInt32(s.Pop());
                    if (s.top != boardSize) // if the top is not null we push to the next spot after poping the previous queen
                        s.Push(Convert.ToInt32(s.Pop()) + 1);
                    else
                        s.Push(x + 1);
                }
                else if (!conflict && s.Count() == boardSize)
                {
                    // If there's no more conflict and the stack size is equal to the board size then we're done
                    success = true;
                }
                else
                {
                    // new row, column 1
                    s.Push(1);
                }
            }

            final = s;
        }