added writing out of the clusters, hopefully the file position saving will work