working on local allocation