slight modification to avoid getting array size