Finished implementing query execution