changed segment variable double pointer to pointer array.