use write/read instead of indexing directly