fixed max purchase function