implement N-Queens task, got my logic fucked up