small changes
added more fields and writing capability