Simpler impl of checking for index