implemented indexOf