added __getitem__ and changed __repr__