Restored commented out sections, and added sql statement