Using indexOf() instead of match()