Creating an array class from a linked list