Added method to pick up Max and Min pixel for Ph Optimisation