trying to figure out where memory runs out