move flattenTerms back before addKCell