Functional example nqueens