Add copy and realloc, implement = and [] operator functions