Cleaned up the cursor, provider, criteria and the document a little.
Still unsure if I want the criteria