implementing array class