fix parsing and added writing partitions