version one complete, version two include min max and integration on graph