first (seemingly) working version of writing native object ids