add max option
add max option to documentation