trying to be more memory efficient