first (uncommented) version of the corpus builder