Cleaned up the code.

getDataRaw is still crashing. I don't know what is causing it.

It seems to crash the 2nd-5th time you run it.

I randomly get a message that the kernel has crashed.
Maybe it is as Colin said, it is caused by matplotlib :S