used for loop to inialize array ptrs to NULL. this is not done by default in C