Finished query implementation