Works but crashes on Memory Overflow.