added a bunch of autorelease pools to fix memory leaks i knew were there but was lazy about