Finished implementing queries