Added FindLastXBeforNaN function to find the last x before y is NaN
Improved function drawer
Minor improvements
Removed testing stuff