added writeCSW by Dany