trying to reduce memory usage