changing to reduce memory usage