Debugging simple Q solver