success writing temple data; code is a giant mess, but some stuff works now