formula for allocation