indexOf version finished