added subscript() method to State