changed to local memory