Enhanced dynamic array class for CS 251