Finalized code for Exploratory

SQLServer runs should work