logic problems in DynArray.cc