cleaned up code and added more elasticsearch examples