Sort:  

That's why I linked the script I used for it! So that you can learn from it and hopefully improve it.. :)

Btw is this script live? I'm not so familiar with Python but the are graphs there which go to 12000 instead of 8000.
Really cool stuff, I was working with R before but I do know OOP (Java, iOS)