Changed malloc to calloc