Added function that frees dynamically allocated array of strings