First Version of Select with Index: Has Errors