Added more comments; Added another check in set min max value function