Working solution with direct access, keeping this copy with old solution using pointer to pointer.
Clean up redundant code