Added read/write functionality