Bit of cleanup
Cleaned up code

Had missed including write.table