Added memory allocation for array.

I think I might need 2 arrays, a before and an after, but we'll see how
I go