Added a max_value function