Remove Realloc and calcuate the basic things