Added setMax and getMax methods.