Updated size()
Updated memory management