changed to add row.names=FALSE to write.table