Added memory upper limit.
Removed memory block struct in favour of array.