change unit containers to dynamically allocate and use pointers