make ranges inclusive of max