added cpi read/write
write.csv without superfluous row names
minor corrections