Trying to implement with one array.