Added N-Queens test-case

Also tidied up some code