1st working version to generate CQL