think I've fixed the humongous memory usage