added writing out of design and clustering complete