implemented operator[] for array