Completed func. spec for query