added x values must be in ascending order error
removed if statment
removed line