bad logic. in either case, I'll remove this != EMPTY from write as they don't avoid alloc.