Implement indexOf