rewrite 8 queens example to use generators