Now using calloc to ensure proper initialisation of memory.