calculate supply function