Get basic query sequence working