added operator[] and operator<<