trying to improve memory usage