Allocating the memory in the right way.