Replaced Array.contains() call with Array.indexOf()