Added __getitem__ function