Added QueryPanel and created state generation