add implementation for __getitem__