Works, but extreme memory usage. (leak?)