Work in progress update of dynamic memory. Current version correctly interprets both sample inputs.