removed an unnecessary loop with calloc