Change 8 queens program to make it faster.