adding a routine to write CMTSOLUTION files + test