This code is not written for the Arduino, you may get bigger problems with memory if you want to run that on an UNO.