almost finished the ready to execute query