Updated Main Program

Ready for production tests for ES searches.