Add function to get array of all nodes in linked list