min max implementation continues ..