More accurate graphs produced

Thanks to http://stackoverflow.com/q/18418477/2425215