Added FindFirstXAfterNaN function