working on allocation optimization